-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improves DCA warnings after divergent expressions. #5726
Conversation
1e7c79c
to
a51b8f6
Compare
a51b8f6
to
66a7789
Compare
Benchmark for c0ee02cClick to view benchmark
|
Benchmark for 69fc978Click to view benchmark
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To the questions on the contains_never
method, maybe it can be done as a different PR, but maybe also as the part of this PR, to extend DCA test for uninhabited types and the cases like the one in the code sample provided in the comment where the variable s
even if used somewhere later will actually always be dead. I expect our DCA with the change in this PR will already behave like that.
In that case we could also close #3496 with this PR.
Benchmark for 7a38cb2Click to view benchmark
|
Benchmark for 5360553Click to view benchmark
|
test/src/e2e_vm_tests/test_programs/should_pass/return_in_strange_positions/src/main.sw
Show resolved
Hide resolved
test/src/e2e_vm_tests/test_programs/should_pass/return_in_strange_positions/src/main.sw
Show resolved
Hide resolved
test/src/e2e_vm_tests/test_programs/should_pass/return_in_strange_positions/src/main.sw
Show resolved
Hide resolved
I left some comments because we are only notifying errors "on the next line", and not on the "next expression", if that makes sense. But I have also approved, because your improvements already improved what we have. |
Improved the DCA algorithm:
|
Benchmark for 1e2fc4bClick to view benchmark
|
Benchmark for f7a685aClick to view benchmark
|
Description
DCA warnings were missing when methods call return in some places.
Changes e2e test runner to use file checker in tests with category runs.
Fixes #5666
Checklist
Breaking*
orNew Feature
labels where relevant.